package mode;


import java.util.Random;

public class Ep extends Flyobject{
     int sp;
     int type;
     int hp;
     public Ep(){
    	 Random rd= new Random();
    	 int index = rd.nextInt(15)+1;
    	 type=index;
    	 img = App.getImg("/img/ep"+index+".png");
    	 x=rd.nextInt(512-w);
    	 y=-h;
    	 h=img.getHeight();
 		 w=img.getWidth();
 		 sp=17-index-1;
 		 hp=index;
     }

	public void move() {
		if (type==15){
			y+=20;
		}else {
			y += sp;
		}

	}

	public boolean shootBy(Fire f) {
		Boolean hit=x<=f.x+f.w&&x>=f.x-w&&y<=f.y+f.h&&y>=f.y-h;
		return hit;
	}

	public boolean hitBy(Heroji f) {
		Boolean hit=x<=f.x+f.w&&x>=f.x-w&&y<=f.y+f.h&&y>=f.y-h;
		return hit;
	}
 

}
